<?php
$cwd = getcwd(); 
if (! preg_match('/admin/i',$cwd)){
# $dbusr = $_SESSION['dbusr'];
# $dbpwd = $_SESSION['dbpwd'];
# $dbase = $_SESSION['dbase'];	

}

	if (!(mysql_connect($serv, $dbusr, $dbpwd))){
		echo "connect_error";
		# require ('error.php');
		exit(); #stop parsing
	} elseif (!($succ = mysql_select_db($dbase))){
		echo "select_error in db_connect";
		# require ('error.php');	
		exit();
	}
?>